<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Course_id')}:</label>
        <div class="col-xs-12 col-sm-8">
            <!-- <input id="c-course_id" data-rule="required" data-source="course/index" class="form-control selectpage" name="row[course_id]" type="text" value="{$row.course_id|htmlentities}"> -->
            {:build_select('row[course_id]', $bankList, $row['course_id'], ['class'=>'selectpicker', 'required'=>''])}
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Typedata')}:</label>
        <div class="col-xs-12 col-sm-8">
            
            <div class="radio">
            {foreach name="typedataList" item="vo"}
            <label for="row[typedata]-{$key}"><input id="row[typedata]-{$key}" name="row[typedata]" type="radio" value="{$key}" {in name="key" value="$row.typedata"}checked{/in} /> {$vo}</label> 
            {/foreach}
            </div>

        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Title')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-title" data-rule="required" class="form-control" name="row[title]" type="text" value="{$row.title|htmlentities}">
        </div>
    </div>
    <div class="form-group option-box">
        <label class="control-label col-xs-12 col-sm-2">{:__('Optionjson')}:</label>
        <div class="col-xs-12 col-sm-8">
            
            <dl class="fieldlist" data-name="row[optionjson]" data-template="addtpl">
               
                <dd><a href="javascript:;" class="btn btn-sm btn-success btn-append"><i class="fa fa-plus"></i> {:__('Append')}</a></dd>
                <textarea name="row[optionjson]" class="form-control hide" cols="30" rows="5">{$row.optionjson|htmlentities}</textarea>
            </dl>


        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Answers')}:</label>
        <div class="col-xs-12 col-sm-8" id="answer-box">
            <input id="c-answers" class="form-control" name="row[answers]" type="text" value="{$row.answers|htmlentities}">
        </div>

        <input type="hidden" name="row[answersvalue]"  value="{$row.answers|htmlentities}">
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Answerscontent')}:</label>
        <div class="col-xs-12 col-sm-8">
            <textarea id="c-answerscontent" class="form-control editor" rows="5" name="row[answerscontent]" cols="50">{$row.answerscontent|htmlentities}</textarea>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Diffdata')}:</label>
        <div class="col-xs-12 col-sm-8">
            
            <div class="radio">
            {foreach name="diffdataList" item="vo"}
            <label for="row[diffdata]-{$key}"><input id="row[diffdata]-{$key}" name="row[diffdata]" type="radio" value="{$key}" {in name="key" value="$row.diffdata"}checked{/in} /> {$vo}</label> 
            {/foreach}
            </div>

        </div>
    </div>
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
        </div>
    </div>
</form>

<script type="text/html" id="addtpl">
    <dd class="form-inline">
        <input type="text" name="row[<%=name%>][<%=index%>][keys]" class="form-control" value="<%=row['keys']%>" size="10" style="width:50px;">
        <input type="text" name="row[<%=name%>][<%=index%>][value]" class="form-control" value="<%=row['value']%>" size="10" style="width:280px;">
        <button class="btn btn-sm btn-warning btn-setanswer">设为答案</button>
        <span class="btn btn-sm btn-danger btn-remove"><i class="fa fa-times"></i></span> <span class="btn btn-sm btn-primary btn-dragsort"><i class="fa fa-arrows"></i></span>
    </dd>
</script>